package com.itheima.app.controller;

import com.itheima.app.interceptor.UserHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class HuanxinController {

    /**
     * app主动发起请求获得 环信用户名密码的接口
     */
    @GetMapping("/huanxin/user")
    public Map getToken(){
        Map map = new HashMap();
        map.put("username", UserHolder.getId()+"");
        map.put("password","123456" );
        System.out.println("主动获得环信的用户名和密码:" + map);

        return map;
    }
}
